import request from '@/utils/request'
import type { type } from 'os'
//顶部轮播数据类型
interface navListData {
    code:string,
    data: {
        checkNavType: boolean,
        navList: navListDataArr,
        delNavId: null
    }
}
type navListDataArr = navListDataArrItem[]
export interface navListDataArrItem {
    id: number,
    picUrl: string,
    mainTitle: string,
    viceTitle: string,
    columnUrl: string,
    onlineType: boolean,
    vaildStartTime: number,
    vaildEndTime: number,
    rank: number
}
//楼层数据类型
export interface RecArrItem{
    schemeUrl: string,   //网址
    nickname: string,
    avatar: string,
    readCount: number,   //用它当循环id
    title: string,
    subTitle: string,
    picUrl: string,
    itemIdList: number[],
    categoryIds: string,
    topicId:string
}
type RecArr = RecArrItem[]
export type Rectopics = {  //没有要look
    topics:RecArr
}
type Rec = {
    code:string
    data:{
        result:Rectopics[]
    }
}
export default {
    //获取nav数据
    getNav() {   
        return request.get<any, navListData>('/topic/v1/know/navWap.json')
    },
    //获取楼层数据
    getRec(page:number,size:number){
        return request.get<any,Rec>(`/topic/v1/find/recAuto.json`,{
            params:{
                page,
                size
            }
        })
    }
}